home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
BARNET
/
COMPILER
/
SATHER
/
!Sather
/
Library
/
IO
/
sa
/
stream
< prev
Wrap
Text File
|
1996-04-09
|
2KB
|
40 lines
---------------------------> Sather 1.1 source file <--------------------------
-- Author: Benedict A. Gomes <gomes@samosa.ICSI.Berkeley.EDU>
-- Copyright (C) 1995, International Computer Science Institute
-- $Id: stream.sa,v 1.2 1996/04/09 10:05:57 borisv Exp $
--
-- COPYRIGHT NOTICE: This code is provided WITHOUT ANY WARRANTY
-- and is subject to the terms of the SATHER LIBRARY GENERAL PUBLIC
-- LICENSE contained in the file: Sather/Doc/License of the
-- Sather distribution. The license is also available from ICSI,
-- 1947 Center St., Suite 600, Berkeley CA 94704, USA.
-------------------------------------------------------------------
abstract class $OSTREAM is
-- A general output stream. A first stab at streams. This
-- abstraction is already useful for routines that might use a file
-- or a string ( a common choice is whether a routine will write to
-- stdout or to a string which may then be printed to a file).
--
-- Usage:
-- write_to_stream(o: $OUTSTREAM) is
-- o + "this is a test";
-- end;
-- Which can be invoked using:
-- write_to_stream(FILE::stdout);
-- or
-- s: STR_STREAM := #;
-- write_to_stream(s);
-- write_to_stream(s);
-- s.str then would have two copies of "this is a test" in it.
plus(s: $STR);
-- Append the string "s" to the stream
plus(s: $STR): SAME;
-- Append the string "s" to the stream and return self
end; -- class $OUTSTREAM
-------------------------------------------------------------------